# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Moritz Bunkus <moritz@bunkus.org>

pkgname='perl-encode-imaputf7'
pkgver=1.05
pkgrel=6
pkgdesc='Modification of UTF-7 encoding for IMAP'
arch=('any')
url='http://search.cpan.org/dist/Encode-IMAPUTF7'
license=('GPL')
checkdepends=('perl-test-nowarnings')
options=('!emptydirs' purge)
source=("http://cpan.metacpan.org/authors/id/P/PM/PMAKHOLM/Encode-IMAPUTF7-${pkgver}.tar.gz")
b2sums=('8024f0029145df4ec409394eaa799612dadd65a1bc6f2e9fdad51a950a0756b73daa5da2579f22d38efd367642a9ae0f7402f6beeea02a51f84a725803849ba6')

build() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  /usr/bin/perl Makefile.PL
  make
}

check() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
